package com.hmall.common.utils;

import lombok.extern.slf4j.Slf4j;
@Slf4j
public class LogUtil {

    public static void logRequest(String path,String method, Object... args) {
        StringBuilder sb = new StringBuilder();
        for (Object arg : args) {
            sb.append(arg).append(", ");
        }
        if (args.length > 0) {
            sb.setLength(sb.length() - 2); // Remove the last ", "
        }
        log.info("线程id =={}",Thread.currentThread().getId());
        log.info("Request method == {}",method);
        log.info("Request path == {}",path);
        log.info("Request Parameters == {}",sb.toString());
    }

    public static void logResponse(String path,String method, Object returnValue) {
        log.info("线程id =={}",Thread.currentThread().getId());
        log.info("Response value == {}",returnValue);
    }
}